package bee2d.spritesheet;

/**
 * ...
 * @author wangjian QQ:421924396
 */
//import nme.geom.Point;
class Behavior 
{
	public var frameRate:Int;
	public var frames:Array <Int>;
	public var loop:Bool;
	public var name:String;
	public var originX:Float;
	public var originY:Float;
	
	private static var uniqueID:Int = 0;
	public function new (name:String = "", frames:Array <Int> = null, loop:Bool = false, frameRate:Int = 30, originX:Float = 0, originY:Float = 0) {
		
		if (name == "") {
			
			name = "behavior_" + (uniqueID++);
			
		}
		
		if (frames == null) {
			
			frames = [];
			
		}
		
		this.name = name;
		this.frames = frames;
		this.loop = loop;
		this.frameRate = frameRate;
		this.originX = originX;
		this.originY = originY;
	}
	
	
	public function clone ():Behavior {
		
		return new Behavior ("behavior_" + (uniqueID++), frames.copy (), loop, frameRate, originX, originY);
		
	}
	
}